package com.tjetc.controller;

import com.tjetc.common.FileUploadUtil;
import com.tjetc.common.JsonResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController

public class ImagesController {

    @Value("${file.basePath}")
    private  String basepath;


    @RequestMapping("image")
    public JsonResult uploadimage(@RequestParam("imageFile") MultipartFile multipartFile){


        String patth= FileUploadUtil.upload(multipartFile,basepath,"images");
        return JsonResult.success(patth);
    }


}


